unsigned long fib(unsigned long n){
    if(n < 2) return n;
    else{
        unsigned long x = 0;
        unsigned long y = 1;
        unsigned long z = -1;
        for(unsigned long i = 0; i <= n - 2; i++){
            z = x + y;
            x = y;
            y = z;
        }
        return z;
    }
}
